#pragma  once
#include "GameEngine.h"
namespace Advanced2D
{
	class Object
	{
	protected:
		int id;
		int objectType;
		bool visible;
		bool alive;
		bool isMoving;
		int currentFrame;
		D3DXVECTOR3 position; 
		bool isCollidable;
		int lifetimeLength;
		Timer lifetimeTimer;

	public:
		// rectangle bound object
		RECT objRect;

		Object();
		virtual ~Object() { };

		virtual void move() = 0;
		virtual void animate() = 0;
		virtual void draw() = 0;
		virtual void draw(RECT)=0;

		void setID(int value) { id = value; }
		int getID() { return id; }
		
		bool IsMoving(){ return isMoving; }
		void setIsMoving(bool isMoving){ this->isMoving=isMoving;}

		bool getVisible() { return visible; }
		void setVisible(bool value) { visible = value; }

		bool getAlive() { return alive; }
		void setAlive(bool value) { alive = value; }

		int getLifetime() { return lifetimeLength; }
		void setLifetime(int milliseconds) { lifetimeLength = milliseconds; lifetimeTimer.reset(); }
		bool lifetimeExpired() { return lifetimeTimer.stopwatch(lifetimeLength); }

		int getObjectType() { return objectType; }
		void setObjectType(int objType) { objectType = objType; }

		D3DXVECTOR3 getPosition(){ return position; }
		void setPostion(D3DXVECTOR3 pos){ position=pos;};

		RECT getObjectRect(){ return objRect; };
		void setObjectRect(RECT rect) { objRect=rect; };

		bool IsCollidable(){return isCollidable; };
		void setCollidable(bool collid){ isCollidable=collid; };

		int getCurrentFrame(){ return this->currentFrame; }
		void setCurrentFrame(int frame){ this->currentFrame=frame; }


	};




}